<template>
  <div>
    <div class="page-header">
      <span class="pre-label">预报器:</span
      ><el-select
        v-model="precursor"
        placeholder="请选择预报器"
        :popper-append-to-body="false"
        @change="handleChange"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </div>
    <page-form
      v-if="precursor == 'SPG4'"
      :formConfig="basicRailConfigSPG4"
      :currentPrecursor="precursor"
    ></page-form>

    <page-form
      v-else-if="precursor == '二体'"
      :formConfig="basicRailConfigERTI"
      :currentPrecursor="precursor"
    ></page-form>
    <page-form
      v-else-if="precursor == 'HPOP'"
      :formConfig="basicRailConfigHPOP"
      :currentPrecursor="precursor"
    >
    </page-form>
  </div>
</template>
<script>
import PageForm from "../../components/pageForm/pageForm";
import basicRailConfigSPG4 from "./config/basicConfigSPG4";
import basicRailConfigERTI from "./config/basicConfigERTI";
import basicRailConfigHPOP from "./config/basicConfigHPOP";
export default {
  components: {
    PageForm,
  },
  data() {
    return {
      basicRailConfigSPG4,
      basicRailConfigERTI,
      basicRailConfigHPOP,
      precursor: "SPG4",
      options: [
        { label: "SPG4", value: "SPG4" },
        { label: "二体", value: "二体" },
        { label: "HPOP", value: "HPOP" },
      ],
    };
  },
  methods: {
    handleChange() {
      console.log("change");
    },
  },
};
</script>
<style scoped>
.pre-label {
  padding-right: 10px;
}
</style>
